<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            height: 40px;
            width: 40px;
            background-color: black;
            float: left;
            text-align: center;
            line-height: 40px;
            font-size: 18px;
            color: white;
            margin: 10px 10px;
        }
    </style>
</head>
<body>
    <div class="h">01</div>
    <div class="m">11</div>
    <div class="s">11</div>
    <script>
        var h = document.querySelector('.h');
        var m = document.querySelector('.m');
        var s = document.querySelector('.s');
        function dida(){
            // var now = Date.now();
            var time1 = new Date();
            var minutes = time1.getMinutes();
            var hour = time1.getHours();
            var second = time1.getSeconds();
            h.innerHTML = hour;
            m.innerHTML = minutes;
            s.innerHTML = second;
        }
        dida();
        window.setInterval(dida,1000);
    </script>
</body>
</html>